<!DOCTYPE html>
<html>
<head>
<title th:text="#{eq.Jobstochoose}">岗位选择</title>
<meta charset="utf-8">
<link rel="stylesheet" th:href="@{/}+'layuiadmin/style/admin.css'" media="all">
<link rel="stylesheet" th:href="@{/}+'plugins/zTree/css/zTreeStyle/zTreeStyle.css'" media="all">
<script th:src="@{/}+'plugins/zTree/js/jquery.ztree.all.min.js'"></script>
  <script th:src="@{/}+'plugins/layui/layui.js'"></script>
<script th:src="@{/}+'js/day.js'"></script>
<style type="text/css">
.layui-inline{
	width:136px!important
}
</style>
</head>
<body>
<div class="layui-fluid">
  <div class="layui-card">  
    <div class="layui-card-body">
    <div class="layui-row layui-col-space20">
    <div class="layui-row layui-col-space2">
    
      <div class="layui-inline">
         <input type="text" id="name" th:placeholder='#{eq.JobTitle}' autocomplete="off" class="layui-input">
      </div>
     <div class="layui-btn-group">
	    <button type="button" class="layui-btn layui-btn-primary" id="queryBtn" data-type="queryBtn" th:text="#{eq.search }">查询</button>
  	</div>
  <div class="layui-row">
  <table id="post-table" lay-filter="post-table"></table>
  </div>
  </div>
  
    </div>
  </div>
</div>
</div>
 <script th:inline="javascript">
/*<![CDATA[*/
var naviid=[[${naviid}]]    
/*]]>*/
</script>
<script th:inline="none">
layui.use(['table','form'], function(){
  var form = layui.form,
  upload = layui.upload
  ,table = layui.table;
  table.render({
	    elem: '#post-table'
	    ,url: 'post/getPageList?v='+new Date().getTime()
	    ,cols: [[
	      {type: 'checkbox'}
	      ,{field: 'id', title: 'ID',hide:true}
	      ,{field: 'name', width: 300, title: i18n('eq.JobTitle')}
	      ,{field: 'code', width: 170, title: i18n('eq.Postcode'),edit:true}
	    ]]
	    ,page: true
	    ,limit: 30
	    ,height: '500px'
	    ,text: i18n('eq.Errorloading')
		,done:function(){
			enableRowClick(table,form,'post-table',"post-table");
		  }
	});
  window.getData = function(){
	  var checkStatus = table.checkStatus("post-table");
      checkData = checkStatus.data; 
      if(checkData.length===0){
    	  return null;
      }
      return checkData[0];
  }
  var action = {
	queryBtn: function(){
		 var whr = {name:$('#name').val()};	 
		 table.reload("post-table",{where:whr}) 
	}
  };
  $('.layui-btn[data-type]').each(function(i,obj){
	  $(this).on('click', function(){
		   var type = $(this).data('type');
		   action[type].call(this);
	  })
  });
});
</script>
</body>